﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class TZA03
    {
        public TZA03()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VZABED();
            this.DataContext = MV;
            InitializeComponent();
        }

        public override void LOADBYAUF()
        {
            TBMain.Clear(); 
            if (ORDERNUM.Length < 3)
                return;
            PM["ZABNR"] = ORDERNUM;
            SResult = ((VZABED)MV).GETZABED(PM);
            MergeData(SResult, true);
            base.LOADBYAUF();
        }
        public override void OnSave()
        {
            if (!IsSaved)
                return;
            Save();
            string _key = KEY;
            KEY = "";
            KEY = _key;//触发关联界面更改
            base.OnSave();
        }
        public override void Save()
        {
            if (dwMaster == null)
                return;
            ((VZABED)MV).UpdateZABED(dwMaster, app.company, 0);
        }
    }
}
